package com.photoeditor.demo.ad;

import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.view.View;

import com.common.commercialize.ad.third.AbsAd;
import com.common.commercialize.ad.third.INativeAd;

import java.util.List;

public class TestAd extends AbsAd implements INativeAd {
    String mTitle;

    public TestAd(String title) {
        mTitle = title;
    }

    @Override
    protected void destroyInternal(Object o) {

    }

    @Override
    protected void loadInternal() {
        onAdLoaded(this);
    }

    @Override
    protected void registerViewForInteractionInternal(View view, View view1, List<View> list) {
        super.registerViewForInteractionInternal(view, view1, list);
        onAdImpression();
    }

    @Override
    protected void unregisterViewForInteractionInternal(Object o) {
        super.unregisterViewForInteractionInternal(o);
    }

    @Override
    public String sdkName() {
        return "test";
    }

    @Nullable
    @Override
    public String getCoverUrl() {
        return null;
    }

    @Nullable
    @Override
    public Drawable getCoverDrawable() {
        return null;
    }

    @Nullable
    @Override
    public String getIconUrl() {
        return null;
    }

    @Nullable
    @Override
    public Drawable getIconDrawable() {
        return null;
    }

    @Override
    public float getStoreRating() {
        return 1;
    }

    @Nullable
    @Override
    public String getAdCallToAction() {
        return "Download";
    }

    @Nullable
    @Override
    public String getAdBody() {
        return "This is a Test Ad!";
    }

    @Nullable
    @Override
    public String getAdTitle() {
        return mTitle;
    }

    @Nullable
    @Override
    public View getMediaView() {
        return null;
    }

    @Override
    public View getAdIconView() {
        return null;
    }

    @Override
    public void destroyMediaView(@Nullable View view) {

    }

    public void  destroyAdIconView(View view) {

    }
}
